const install = (Vue, vm) => {
	//根据code获取token
	let GetTokenByCode = (params) =>
		vm.$u.http.get("/Login/GetTokenByCode/" + params.appid + "/" + params.code);

	let GetUserByCode = (params) =>
		vm.$u.http.get("/Login/GetUserByCode/" + params.appid);

	// 保管单位
	let GetCenterDept = () => vm.$u.http.get("/User/GetCenterDept/");

	// 购置单位
	let GetPurchase = () => vm.$u.http.get("/DeptPower/GetPurchase/");

	// 查部门用户

	let GetDetpUserInfo = (params) =>
		vm.$u.http.get("/User/GetDetpUser/" + params.type, {
			params,
		});
	// 资产来源
	let ZCLY = () => vm.$u.http.get("/Dictionaries/GetOption/ZCLY/");

	// 资产属性
	let ZCSX = () => vm.$u.http.get("/Dictionaries/GetOption/ZCSX/");

	// 取得方式
	let QDFS = () => vm.$u.http.get("/Dictionaries/GetOption/QDFS/");

	// 状态
	let ZCZT = () => vm.$u.http.get("/Dictionaries/GetOption/ZCZT/");

	// 资产大类
	let GetClassOption = () => vm.$u.http.get("/DicClass/GetClassOption/");

	// 资产小类
	let GetClassOptionByPid = (params) =>
		vm.$u.http.get("/DicClass/GetClassOptionByPid/" + params.pid);

	// 工程项目
	let GetOption = () => vm.$u.http.get("/DicProject/GetOption/");

	// 资产列表
	let GetSeachList = (params = {}) =>
		vm.$u.http.post("/Assets/GetSeachList", params);

	// 搜索人员
	let GetSeacTree = (params) =>
		vm.$u.http.get("/User/GetSeacTree/" + params.seach);

	// 资产转移
	let GetList = (params) =>
		vm.$u.http.get("/AssetsDivert/GetList/" + params.pageIndex, {
			params,
		});

	// 根据资产编号查询附属资产
	let GetDetils = (params) =>
		vm.$u.http.get("/Assets/GetDetils/" + params.objectID);

	// 查询申请详情
	let DivertGetDetils = (params) =>
		vm.$u.http.get("/AssetsDivert/GetDetils/" + params.objectID);
	// 查询申请详情
	let GetDeposit = (params = {}) =>
		vm.$u.http.get("/Assets/GetDeposit", {
			params,
		});
	//修改资产信息
	let UpdateAsset = (params = {}) =>
		vm.$u.http.post("/Assets/UpdateAsset", params);

	// 审批流程
	let GetExFlow = (params) =>
		vm.$u.http.get("/AssetsDivert/GetExFlow/" + params.objectID);

	// 获取审批人
	let GetExUser = (params) =>
		vm.$u.http.get("/AssetsDivert/GetExUser/" + params.objectID);

	// 提交审批
	let DoEx = (params = {}) => vm.$u.http.post("/AssetsDivert/DoEx/", params);

	//资产转移
	let NewApply = (params = {}) =>
		vm.$u.http.post("/AssetsDivert/NewApply", params);

	// 资产报废列表
	let AssetsScrapGetList = (params) =>
		vm.$u.http.get("/AssetsScrap/GetList/" + params.pageIndex, {
			params,
		});



	//报废查询申请详情
	let AssetsScrapGetDetils = (params) =>
		vm.$u.http.get("/AssetsScrap/GetDetils/" + params.objectID);

	//报废获取审批流程
	let AssetsScrapGetExFlow = (params) =>
		vm.$u.http.get("/AssetsScrap/GetExFlow/" + params.objectID);

	//报废获取单位负责人
	let GetYJDWJBR = (params) =>
		vm.$u.http.get("/AssetsScrap/GetYJDWJBR/");

	//报废审批
	let AssetsScrapDoEx = (params = {}) => vm.$u.http.post("/AssetsScrap/DoEx/", params);

	//取消申请
	let CancelEx = (params = {}) => vm.$u.http.post("/ExHelper/CancelEx/", params);

	//首页信息
	let PhoneIndexInfo = (params) =>
		vm.$u.http.get("/Homepage/PhoneIndexInfo/" + params.detpID);

	//盘点全部列表
	let Inventorylist = (params) =>
		vm.$u.http.get("/Inventory/GetList/" + params.pageIndex);

	//盘点详情
	let GetDetails = (params) =>
		vm.$u.http.get("/Inventory/GetDetails/" + params.objectID);

	//盘点新增修改
	let AddOrUpdate = (params = {}) => vm.$u.http.post("/Inventory/AddOrUpdate/", params);


	//盘点删除
	let InventoryDelete = (params) =>
		vm.$u.http.post("/Inventory/Delete/" + params.objectID);


	//盘点记录
	let GetLogList = (params) =>
		vm.$u.http.get("/Inventory/GetLogList/" + params.pageIndex, {
			params,
		});

	//判断是否为权限盘点资产
	let SelectInventory = (params) =>
		vm.$u.http.get("/Assets/SelectInventory/" + params.assetNo);

	//根据资产编号查询资产信息
	let GetDetilsByNo = (params) =>
		vm.$u.http.get("/Assets/GetDetilsByNo/" + params.assetNo);

	// /手机端盘点
	let PhoneManual = (params = {}) => vm.$u.http.post("/Inventory/PhoneManual/", params);

	//获取位置
	let GetLocation = (params) =>
		vm.$u.http.get("/WxTool/GetLocation/", params.gps);

	//获取我接收到的最新消息(最近5条)
	let GetMyNewMsg = (params) =>
		vm.$u.http.get("/SendMsg/GetMyNewMsg/");


	//获取位置

	let GetAssetLog = (params) =>
		vm.$u.http.get("/Assets/GetAssetLog/" + params.assetNo);

	// 获取我的鉴定资产
	let GetMyTask = (params) =>
		vm.$u.http.get("/DoScrap/GetMyTask/" + params.pageIndex, {
			params,
		});

	//分配鉴定人
	let Distribution = (params = {}) => vm.$u.http.post("/DoScrap/Distribution/", params.objectID);


	//鉴定资产
	let Appraisal = (params = {}) => vm.$u.http.post("/DoScrap/Appraisal/", params);

	//鉴定记录
	let GetMyLog = (params) =>
		vm.$u.http.get("/DoScrap/GetMyLog/" + params.pageIndex, {
			params,
		});
	//盘点记录
	let GetProgress = (params) =>
		vm.$u.http.get("/Inventory/GetProgress/" + params.deptID, {
			params,
		});

	//批量获取审批人
	let GetBatchExUser = (params = {}) => vm.$u.http.post("/AssetsDivert/GetBatchExUser/", params);
	
	//批量审批
	let BatchEx = (params = {}) => vm.$u.http.post("/AssetsDivert/BatchEx/", params);
	
	 // 处置列表
	let Pretreatment = (params) =>
		vm.$u.http.get("/Pretreatment/GetList/" + params.pageIndex, {
			params,
		});


	vm.$u.api = {
		GetTokenByCode,
		GetUserByCode,
		GetCenterDept,
		GetDetpUserInfo,
		ZCLY,
		ZCSX,
		QDFS,
		ZCZT,
		GetClassOption,
		GetClassOptionByPid,
		GetOption,
		GetSeacTree,
		GetList,
		GetSeachList,
		GetDetils,
		DivertGetDetils,
		GetDeposit,
		UpdateAsset,
		GetExFlow,
		GetExUser,
		DoEx,
		GetPurchase,
		NewApply,
		AssetsScrapGetList,
		AssetsScrapGetDetils,
		AssetsScrapGetExFlow,
		GetYJDWJBR,
		AssetsScrapDoEx,
		CancelEx,
		PhoneIndexInfo,
		Inventorylist,
		AddOrUpdate,
		GetDetails,
		InventoryDelete,
		GetLogList,
		SelectInventory,
		GetDetilsByNo,
		PhoneManual,
		GetLocation,
		GetMyNewMsg,
		GetAssetLog,
		GetMyTask,
		Distribution,
		Appraisal,
		GetMyLog,
		GetProgress,
		GetBatchExUser,
		BatchEx,
		Pretreatment
	};
};

export default {
	install,
};
